package edu.hwadee.action;

import java.util.List;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ModelDriven;


import edu.hwadee.entity.Carbusiness;

public class CarbusinessAction extends BasicAction implements ModelDriven<Carbusiness>{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Carbusiness carbusiness=new Carbusiness();

	public String showCarBussiness() {
		List<Carbusiness> list=(List<Carbusiness>) getCarbusinessServiceImpl().showAll();
		ServletActionContext.getRequest().getSession().setAttribute("carbussinessList", list);
		
		return "success";
		
	}
	
	public Carbusiness getCarbusiness() {
		return carbusiness;
	}

	public void setCarbusiness(Carbusiness carbusiness) {
		this.carbusiness = carbusiness;
	}

	@Override
	public Carbusiness getModel() {
		if(carbusiness==null)
			carbusiness=new Carbusiness();
		return carbusiness;
	}
}
